<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>selectionDashArray 虚线</title>
</head>
<body>
  <canvas id="canvasBox" width="600" height="600" style="border: 1px solid #ccc;"></canvas>

  <script src="../../script/fabric.js"></script>
  <script>
  
    let canvas = new fabric.Canvas('canvasBox', {
      selectionColor: 'transparent',
      selectionBorderColor: 'red',
      selectionDashArray: [10, 20, 30] 
    })
  
    // 椭圆
    const ellipse = new fabric.Ellipse({
      top: 100,
      left: 200,
      rx: 100,
      ry: 50,
      fill: '#ddd',
      originX: 'center', // 旋转x轴：left, right, center
      originY: 'center' // 旋转y轴：top, bottom, center
    })
  
    canvas.add(ellipse)
  
  </script>
</body>
</html>